// Base
// ----------------------------------------------------- //

html {
  font-size: 62.5%;
  color: #222;
}

body {
  overflow-y: scroll;

  @include font-size(1.6);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: underline;

  &:hover {}
  &:active {}
  &:visited {}
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0.5em;
  margin-bottom: 0.5em;

  & + p, & + ul, & + ol {
    margin-top: 0;
  }
}

ul, ol {
  padding-left: 2em;
}

code {
  padding: 0.1em 0.3em;
  margin: 0;
  font-size: 0.9em;
  background-color: rgba(0,0,0,0.04);
  border-radius: 3px;
}

pre {
  border-left: solid 2px lighten($primary-color, 10%);
  padding: 5px 0 5px 10px;
  max-width: 50em;
  line-height: 1.4em;

  & > code {
    padding: 0;
    margin: 0;
    font-size: 0.9em;
    background: none;
    border-radius: 0;
  }

  .hll {
    background-color: fade-out($primary-color, 0.93);
    display: block;
    margin-left: -10px;
    padding-left: 10px;
  }
}

figure.highlight {
  margin-left: 0;
}

@include respond-to(extra-small) {
  body {
    @include font-size(1.4);
  }
}

/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * These selection rule sets have to be separate.
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers:
 * http://juicystudio.com/article/screen-readers-display-none.php
 */

.hidden {
  display: none !important;
  visibility: hidden;
}

/*
 * Hide only visually, but have it available for screen readers:
 * http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 */

.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/*
 * Extends the .visuallyhidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
  content: " "; /* 1 */
  display: table; /* 2 */
}

.clearfix:after {
  clear: both;
}
